﻿@page "/template"
@page "/template/index"
@attribute [Authorize(Roles = "User, Administrator")]
@inherits OwningComponentBase<ICovenantService>

@using Covenant.Core
@using Covenant.Models.Grunts

<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pb-2 mb-3">
    <h1 class="h2">ImplantTemplates</h1>
</div>

<ImplantTemplateTable ImplantTemplates="ImplantTemplates" />

<a href="/template/create" class="btn btn-primary">
    <span class="fe fe-plus"></span>
    Create
</a>

@code {
    [Parameter]
    public IEnumerable<ImplantTemplate> ImplantTemplates { get; set; }

    protected override async Task OnInitializedAsync()
    {
        this.ImplantTemplates = this.ImplantTemplates ?? await Service.GetImplantTemplates();
    }
}
